package jps_s10996_s7175.result;

import java.util.LinkedList;

import edu.pjwstk.jps.interpreter.qres.IQResStack;
import edu.pjwstk.jps.result.IAbstractQueryResult;

public class QResStack implements IQResStack {

    LinkedList<IAbstractQueryResult> stack;

    public QResStack() {
        this.stack = new LinkedList<IAbstractQueryResult>();
    }

    @Override
    public IAbstractQueryResult pop() {
        if (this.stack.size() > 0) {
            return this.stack.pop();
        } else {
            return null;
        }
    }

    @Override
    public void push(IAbstractQueryResult value) {
        this.stack.push(value);
    }

    @Override
    public String toString() {
        return stack + "";
    }

}
